package com.github.binarywang.demo.wx.mp.builder;

import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;


public class NewsBuilder extends AbstractBuilder {
    @Override
    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage, WxMpService service) {

//        String link = MiniQrService.getQr(unionId,deviceId);
        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
        item.setUrl("");
        item.setTitle("点我领取环保袋");
        item.setDescription("零塑生活,还地球一片蓝!\n本链接 1 次有效!");
        item.setPicUrl("https://lssh.oss-cn-shenzhen.aliyuncs.com/static/web/icon/cr.png");

        return  WxMpXmlOutMessage.NEWS()
            .addArticle(item)
            .toUser(wxMessage.getFromUser())
            .fromUser(wxMessage.getToUser())
            .toUser(wxMessage.getFromUser())
            .build();
    }
}
